<%@ page language="Java" import="java.util.*,descriptor.*,cv.*" %>
<%
	int day = (Integer)request.getAttribute("day");
	int month = (Integer)request.getAttribute("month");
	int year = (Integer)request.getAttribute("year");
	
	String date ="";
	if(day>0)
	{
		date = month+"/"+day+"/"+year +" 9:00";
	}
	
	String error1 = (String)request.getAttribute("error1");
	String notif = "";
	
	if(error1 != null)
	{
		notif = "<p style=\"color:red; font-size: 10px;\">" + error1 + "</p>";
	}
	
%>
<html>
	<jsp:include page="StudentHeader.jsp" >
		<jsp:param name="pageTitle" value="Work Placement Management System - Student" />
	</jsp:include>
	<body OnLoad="showmenu(document.getElementById('smenu2'));">
		<jsp:include page="StudentPageHeader.jsp"></jsp:include>
		<div id="container">
			<jsp:include page="StudentMenu.jsp" ></jsp:include>
			<div id="content">
				<h3 class="posttitle">Student - Add an event</h3>
				<div class="entry">
					<%= notif %>
					<form method="post">
						<fieldset>
							<legend>Define the event</legend>
							<input type="hidden" name="action" value="addedEvent">
							<p>Single event <input OnClick="showmenu(document.getElementById('end')); showmenu(document.getElementById('recruiter')); showmenu(document.getElementById('offer'));" type="radio" name="eventType" checked> Multiple event <input OnClick="showmenu(document.getElementById('end')); showmenu(document.getElementById('recruiter')); showmenu(document.getElementById('offer'));" type="radio" name="eventType"> </p>
							<p>Start: <input type="text" id="calendar1" name="calendar1" value="<%= date %>"><button type="button" id="trigger1">Choose the date</button>
							    <script type="text/javascript">
							      Zapatec.Calendar.setup({
							        firstDay          : 1,
							        range             : [2008.01, 2999.12],
							        electric          : false,
							        inputField        : "calendar1",
							        button            : "trigger1",
							        ifFormat          : "%m/%e/%Y %H:%M",
							        showsTime		  : true,
							        timeFormat 		  : "24",
							        timeInterval	  : 30,
							        noHelp			  : true,
							        daFormat          : "%m/%d/%Y"
							      });
							     </script>
								<br>
								<div id="end" style="display: none;">
									End: <input type="text" id="calendar2" name="calendar2"><button type="button" id="trigger2">Choose the date</button>
								    <script type="text/javascript">
								      Zapatec.Calendar.setup({
								        firstDay          : 1,
								        range             : [2008.01, 2999.12],
								        electric          : false,
								        inputField        : "calendar2",
								        button            : "trigger2",
								        ifFormat          : "%m/%d/%Y",
								        daFormat          : "%m/%d/%Y",
								        noHelp			  : true
								      });
								     </script>
								</div>
							</p>
							<p >Event: <input type="text" name="nameEvent"></p>
							<p id="recruiter" style="display: block">Recruiter: <input type="text" id="recruiter" name="recruiterName"></p>
							<p id="offer" style="display: block">Offer: <input type="text"name="offerName"></p>
							<fieldset>
								<legend>Add this event</legend>
								<p><button type="submit">Add Event</button><button type="reset">Clear</button></p>
							</fieldset>
						</fieldset>				
					</form>	
				</div>
	    	</div>
			<jsp:include page="StudentPageFooter.jsp"></jsp:include>
		</div>
	</body>
</html>